package com.d0311hm;

import java.util.Scanner;

public class Test4 {
    public static void main(String[] args) {
        int a, num;
        int price =0;
        Scanner sc = new Scanner(System.in);
        System.out.println("欢迎使用租车系统");
        System.out.println("请问你是否要租车？\n 1 是   0 否");
        int i = sc.nextInt();
        if (i == 1) {
            System.out.println("******您可租车的类型及其价目表******");
            System.out.println("序号1：汽车名称：奥迪A4?租金500/天?容量：最多载人4人");
            System.out.println("序号2：汽车名称：马自达6?租金400/天?容量：最多载人4人");
            System.out.println("序号3：汽车名称：皮卡雪6?租金450/天?容量：最多载人4人?最多载货2吨");
            System.out.println("序号4：汽车名称：金龙?租金800/天?容量：最多载人20人");
            System.out.println("序号5：汽车名称：松花江?租金400/天?容量：最多载货4吨");
            System.out.println("序号6：汽车名称：依维柯?租金1000/天?容量：最多载货20吨");
        }
        System.out.println("请输入您要租汽车的数量:");
        num = sc.nextInt();
        System.out.println("请输入您要租车的序号和天数");
        int[] m = new int[num];
        int[] n = new int[num];
        int[] money = new int[num];
        for (a = 0; a < num; a++) {
            m[a] = sc.nextInt();
            n[a] = sc.nextInt();
        }
        System.out.println("您的账单是：");
        for (a = 0; a < num; a++) {
            money[a]=0;
            switch (m[a]) {
                case 1:
                    money[a]= n[a] * 500;
                    System.out.println("  奥迪A4    " + n[a] + "天");
                    break;
                case 2:
                    money[a]= n[a] * 400;
                    System.out.println("   马自达6    " + n[a] + "天");
                    break;
                case 3:
                    money[a]=n[a] * 450;
                    System.out.println("   皮卡雪6    " + n[a] + "天");
                    break;
                case 4:
                    money[a]=n[a] * 800;
                    System.out.println("   金龙     " + n[a] + "天");
                    break;
                case 5:
                    money[a]= n[a] * 400;
                    System.out.println("   松花江    " + n[a] + "天");
                    break;
                case 6:
                    money[a]=n[a] * 1000;
                    System.out.println("   依维柯    " + n[a] + "天");
                    break;
            }
        }
        for (a=0;a<num;a++){
            price +=money[a];
        }
        System.out.println("总价格：" + price + "元");
    }


}
